
<%@ page language="java" %>

<%@ page import="java.util.List,
                java.util.ArrayList,
                java.util.Iterator,
                com.scalar.chiptrack.utils.StringUtils,
                com.scalar.chiptrack.commons.Address,
                com.scalar.chiptrack.operations.packingslip.forms.PackingSlipForm,
                com.scalar.chiptrack.sales.SalesOrder,
                com.scalar.chiptrack.sales.LineItem,
                com.scalar.chiptrack.utils.ConfigManager,
                com.scalar.chiptrack.commons.SessionKeys,
                com.scalar.chiptrack.commons.Constants,
                com.scalar.chiptrack.users.User,
                com.scalar.chiptrack.users.Functionality,
                com.scalar.chiptrack.operations.packingslip.forms.CommercialInvoiceForm,
                com.scalar.chiptrack.commons.Constants"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/commercialInvoice.do"/>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<% User user1 = (User)session.getAttribute (SessionKeys.USER_KEY); %>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js">
</script>
<SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/validations.js">
</script>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<SCRIPT language="JavaScript">


function saveInvoice()
{
    document.commercialInvoiceForm.submit();
}

function cancelAndGoBack()
{
    document.commercialInvoiceForm.action = "<%=chipTracContext%>/commercialInvoice.do?action=loadPackingSlips";
    document.commercialInvoiceForm.submit();
}

function showInvoice()
{
    if( ( document.commercialInvoiceForm.salesOrderId.value != -1 ) && ( document.commercialInvoiceForm.customerShippingId.value != -1 ) )
    {
        var invoiceURL = "<%=chipTracContext%>/commercialInvoice.do?action=showInvoice&salesOrderId=" + document.commercialInvoiceForm.salesOrderId.value + "&customerShippingId=" + document.commercialInvoiceForm.customerShippingId.value;
        newWindow = window.open (invoiceURL,'commInvoicePrinterFriendly','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,resizable=yes');
        newWindow.focus();
    }
}

function deleteInvoice(){

    // added by hareesh on 28th July 2003
    // -- START --
    document.commercialInvoiceForm.action = "<%=chipTracContext%>/commercialInvoice.do?action=delete";
    document.commercialInvoiceForm.submit();
    // -- END--
}

// Balaram on July 29, 2003
function showErrorReportPage()
{
    newWindow = window.open ('<%=chipTracContext%>/reportProblem.do','reportProblem','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=750,height=400,resizable=no');
    newWindow.focus();
}


</SCRIPT>
<%
    // added by hareesh on 28th July 2003
    // -- START --
    String action = "";
    try{
        action = request.getParameter("action").trim();
    }catch(Exception ex){
        action = "";
    }
    // -- END --
%>

<!-- Top Header Start-->
<%@include file="/jsp/includes/header.jsp"  %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width="180" valign="top" background="<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif">

<!-- Side Navigation start -->
<%@include file="/jsp/operations/operations_menu.jsp" %>
<!-- end of the side navigations -->


<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>


<!-- body starts -->

<center><span class="NArialW">Commercial Invoice</span></center>
    <%
        // changed by hareesh on 28th July 2003
        // -- START --
    if("deleteConfirm".equalsIgnoreCase(action)==false){
    %>
       <center>&nbsp;&nbsp;<a href="javascript:showInvoice()" onMouseOver="window.status='Click for Printer Friendly Version';return true" onMouseOut="window.status='';return true" title="Click here for Printer Friendly version"><font class="NArialS"><b>[Printer-Friendly]</b></font></a></center>
    <%
    } else {
    %>
      <center>&nbsp;&nbsp;<font class="NArialS" color="red"><b>Are you sure, you want to Remove from listing this Commerical Invoice ? </b></font>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <chiptrack:restrictedLink functionality='<%=Functionality.COMMERCIAL_INVOICE%>' action='<%=User.USER_ACTION_DELETE%>' href='javascript:deleteInvoice();' onmouseover="window.status='Click to Confirm Remove Commercial Invoice';return true" onmouseout="window.status='';return true">
      <img border="0" src="<%=chipTracContext%>/jsp/includes/images/confirm.gif" title="Click here to Confirm Remove Commercial Invoice"></chiptrack:restrictedLink>
      &nbsp;&nbsp;&nbsp;&nbsp;
	  <a href="javascript:cancelAndGoBack();" onMouseOver="window.status='Click to Cancel and go Back';return true" onMouseOut="window.status='';return true" title="Click here to Cancel and go Back "><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif"></a>
      </center>
    <%
    }
     // -- END --
    %>

<html:form name="commercialInvoiceForm" type="com.scalar.chiptrack.operations.packingslip.forms.CommercialInvoiceForm" action="/commercialInvoice.do?action=save">
<html:hidden name="commercialInvoiceForm" property="customerShippingId"/>
<html:hidden name="commercialInvoiceForm" property="salesOrderId"/>
<html:hidden name="commercialInvoiceForm" property="packingSlipNumber"/>
<html:hidden name="commercialInvoiceForm" property="totalWeight"/>
<html:hidden name="commercialInvoiceForm" property="totalPackages"/>
<html:hidden name="commercialInvoiceForm" property="status"/>
<%--<html:hidden name='commercialInvoiceForm' property='shippingFromLocationId'/>--%>


    <%
        // added by hareesh on 5th September 2003
        CommercialInvoiceForm commericalInvoiceForm = (CommercialInvoiceForm) request.getAttribute ("commercialInvoiceForm");

        SalesOrder salesOrder = (SalesOrder) request.getAttribute ("salesOrder");

        if( salesOrder != null )
        {
            Address billingAddress = salesOrder.getBillingAddressAsObject();
            // changed by hareesh on 5th September 2003
            Address shippingAddress = salesOrder.getShippingAddressAsObject();
            //Address shippingAddress = commericalInvoiceForm.getShippingAddress();
    %>

    <table width="95%" cellspacing="0" cellpadding="0" border=0 align=center>

        <tr><td colspan="5"><chiptrack:info styleClass="NArialL"/></td></tr>
        <tr><td colspan="5"><chiptrack:errors styleClass="NArialL"/></td></tr>
        <% if ( !user1.isActionAllowed ( Functionality.COMMERCIAL_INVOICE,
            User.USER_ACTION_MODIFY ) ) { %>
        <tr><td colspan="5"><font class="NArialS"><font color="blue">
        <b><%=Constants.NO_MODIFY_RIGHTS %></b>
        </font><td><tr>
        <% } %>
        <!--changed by hareesh on 20th August 2003-->
        <!-- START : to include Ship to address -->
        <tr height=30>
            <td width="34%" class="NArialL" bgcolor="#DEE1E2" >&nbsp;Shipper :</td>
            <td width="1%"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
            <td widht="30%" class="NArialL" bgcolor="#DEE1E2">&nbsp;Bill To :</td>
            <td width="1%"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
            <td width="34%"  bgcolor="#DEE1E2"><font class="NArialL">&nbsp;Ship To :</font></td>
        </tr>
        <tr>
            <td bgcolor="#FFFFEE" class="NArialL" valign="top">
                <table width="100%" class="NArialL" valign="top">
                    <tr>
                        <td>
                            <bean:write  name="commercialInvoiceForm" property="clientName"/>
                            <%--<logic:notEmpty name="commercialInvoiceForm" property="vendorName">
                                c/o &nbsp; <bean:write  name="commercialInvoiceForm" property="vendorName"/>
                            </logic:notEmpty>--%>
                           <br>
                            <bean:write name="commercialInvoiceForm" property="shipperVendorAddressAsHTML" filter="false"/> <%--// Added by Krishna Prasad on 26 May 2004--%>
                        </td>
                    </tr>
                </table>
            </td>
            <td width="1%"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
            <td bgcolor="#FFFFEE" class="NArialL" valign="top">
                <table width="100%" class="NArialL"><tr><td valign="top">
                    <%--<logic:notEmpty name="commercialInvoiceForm" property="billingAddressObject">
                        <logic:notEqual name="commercialInvoiceForm" property="billingAddressObject.contactPerson" value="<%=salesOrder.getCustomerName()%>">
                            <%=salesOrder.getCustomerName()%><br>
                        </logic:notEqual>
                    </logic:notEmpty>
                    <logic:empty name="commercialInvoiceForm" property="billingAddressObject">
                        <%=salesOrder.getCustomerName()%><br>
                    </logic:empty>--%>

                   <bean:write name="commercialInvoiceForm" property="billingAddressAsHTML" filter="false"/>
                </td></tr></table>
            </td>
            <!-- END -->
            <td width="1%"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
            <td bgcolor="#FFFFEE" class="NArialL" valign="top">
                <table width="100%" class="NArialL"><tr><td valign="top">
                    <%--<logic:notEmpty name="commercialInvoiceForm" property="shippingAddressObject">
                        <logic:notEqual name="commercialInvoiceForm" property="shippingAddressObject.contactPerson" value="<%=salesOrder.getCustomerName()%>">
                            <%=salesOrder.getCustomerName()%><br>
                        </logic:notEqual>
                    </logic:notEmpty>
                    <logic:empty name="commercialInvoiceForm" property="shippingAddressObject">
                        <%=salesOrder.getCustomerName()%><br>
                    </logic:empty>--%>
                    <bean:write name="commercialInvoiceForm" property="shippingAddressAsHTML" filter="false"/>
            </td></tr></table>

            </td>
       </tr>
       <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tR>

       <tr>
            <td class="NArialL" colspan="5">
                <table width="100%" class="NArialL">
                    <tr height=30>
                        <td bgcolor="#DEE1E2" align=center>Customer PO#</td>

        <%-- Modified by Murali Krishna, 15 Feb, 2005 --%>
        <%-- <td bgcolor="#DEE1E2" align=center>Sales Order#</td> --%>
        <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() ))
        {
        %>
                        <td bgcolor="#DEE1E2" align=center>Sales Order#</td>
        <%
        }
        else
        {
        %>
            <logic:equal name='commercialInvoiceForm' property='isSample' value='true'>
                        <td bgcolor="#DEE1E2" align=center >Sample Sales Order#</td>
            </logic:equal>
            <logic:notEqual name='commercialInvoiceForm' property='isSample' value='true'>
                        <td bgcolor="#DEE1E2" align=center>Sales Order#</td>
            </logic:notEqual>
        <%
        }
        %>
        <%-- End: Murali Krishna --%>


                        <td bgcolor="#DEE1E2" align=center>Packing Slip#</td>
                        <td bgcolor='#DEE1E2' align=center><bean:message key="label.commercialInvoice.commercialInvoiceNo"/></td>
                        <td bgcolor="#DEE1E2" align=center>INCOTERMS</td>
						<td bgcolor="#DEE1E2" align=center>Way Bill</td>
                        <td bgcolor='#DEE1E2' align=center>Country of <br>Origin(Fab)</td>
                        <td bgcolor='#DEE1E2' align=center>Country of <br>Origin(Assy)</td>
                       <%-- <td bgcolor="#DEE1E2" align=center>Loading Port</td>
                        <td bgcolor="#DEE1E2" align=center>Destination<br> Port</td>--%>
                    </tr>
                    <tr height=30>
                        <td bgcolor="#FFFFEE" nowrap align=center><%=((salesOrder.getCustomerPO() == null) ? "" : salesOrder.getCustomerPO())%></td>
                        <td bgcolor="#FFFFEE" nowrap align=center><%=salesOrder.getSalesOrderNo()%></td>
                        <td bgcolor="#FFFFEE" nowrap align=center><bean:write name="commercialInvoiceForm" property="packingSlipNumber"/></td>
                        <td bgcolor="#FFFFEE" nowrap align=center><bean:write name="commercialInvoiceForm" property="commercialInvoiceNo"/></td>
                        <td bgcolor="#FFFFEE" nowrap align=center><!-- changed by hareesh on 7th August 2003 -->
                        <!-- START -->
                        <%//=( ( salesOrder.getDeliveryTerms() == null ) || ( salesOrder.getDeliveryTerms().trim().length() == 0 ) ) ? "&nbsp;" : salesOrder.getDeliveryTerms()%>
                        <bean:write name="commercialInvoiceForm" property="fob" />
                        <html:hidden name="commercialInvoiceForm" property="fob" />
                        <!-- END -->
                        </td>
						<td bgcolor="#FFFFEE" align=center>
							<table class="NArialL">
							 <logic:iterate name="commercialInvoiceForm" property="frieghtTrackingNumber" id="track">
							<tr><td>
								<bean:write name="track"/>&nbsp;
							</td></tr>
							</logic:iterate>
							</table>	
						</td>
                         <%
                            if("deleteConfirm".equalsIgnoreCase(action)==false){
                        %>
                        <%--<td bgcolor="#FFFFEE" nowrap align=center>--%>
                        <td bgcolor='#FFFFEE' nowrap align=center><html:text name='commercialInvoiceForm' property='countryOfFabOrigin' styleClass='txfield' maxlength='50'/></td>
                        <td bgcolor='#FFFFEE' nowrap align=center><html:text name='commercialInvoiceForm' property='countryOfAssyOrigin' styleClass='txfield' maxlength='50'/></td>
                            <%--<html:text name="commercialInvoiceForm" property="portOfDestination" styleClass="txfield" maxlength='50'/>--%>
                        <%
                            } else {
                        %>
                          <%--  <bean:write name="commercialInvoiceForm" property="portOfDestination" />--%>
                        <td bgcolor='#FFFFEE' nowrap align=center><bean:write name='commercialInvoiceForm' property='countryOfFabOrigin' /></td>
                        <td bgcolor='#FFFFEE' nowrap align=center><bean:write name='commercialInvoiceForm' property='countryOfAssyOrigin' /></td>

                        <%
                            }
                        // -- END --
                        %>
                        </td>
                    </tr>
                </table>
            </td>
       </tr>
	   <tr><td colspan="5" class='NArialL' align='left'>Comments</td></tr>
	   <tr><td colspan="5" class='NArialL' align='left'>
	   <html:textarea rows="3" name="commercialInvoiceForm" property="comments" cols="100" styleClass="txfield"  onkeydown="javascript:setTextAreaMaxLength(document.commercialInvoiceForm.comments,300)" onkeyup="javascript:setTextAreaMaxLength(document.commercialInvoiceForm.comments,300)"/>
	   </td></tr>

       <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tR>

       <tr><td colspan="5"><hr></td></tr>

       <tr><td colspan="5">
       <table width="100%" border=0 cellpadding="0" cellspacing="2" bordercolor="#000000">
            <tr height=30>
                <!--td class="NArialL" bgcolor="#DEE1E2" align=center>Line#</td-->
                <td class="NArialL" bgcolor="#DEE1E2" align=center>PO Line Item</td>
                <% if (ConfigManager.getBooleanProperty(ConfigManager.SHOW_MFG_PARTNO_PACKINGSLIP ) ) { %>
                <td class="NArialL" bgcolor='#DEE1E2' align=center>
				<bean:message key = "label.mfgPartNumber" /></td>
                <% } %>
                <% if (ConfigManager.getBooleanProperty(ConfigManager.SHOW_MRKT_PARTNO_PACKINGSLIP ) ) { %>
                <td class="NArialL" bgcolor='#DEE1E2' align=center>
				<bean:message key = "label.mktgPartNumber" /></td>
                <% } %>
                <td class="NArialL" bgcolor="#DEE1E2" align=center>
				<bean:message key = "label.customerPartNumber" /></td>
                <td class="NArialL" bgcolor="#DEE1E2" align=center>Product <br>Description</td>
				<td class="NArialL" bgcolor="#DEE1E2" align=center>Units</td>
                <td class="NArialL" bgcolor="#DEE1E2" align=center><bean:message key="label.commercialInvoice.ScheduleNumber"/></td>
                <td class="NArialL" bgcolor="#DEE1E2" align=center><bean:message key="label.commercialInvoice.ScheduleNumberDiscription"/></td>
				<td class="NArialL" bgcolor="#DEE1E2" align=center><bean:message key="label.commercialInvoice.ECCN"/></td>
				<td class="NArialL" bgcolor="#DEE1E2" align=center><bean:message key="label.commercialInvoice.LicenseSymbol"/></td>
                <td class="NArialL" bgcolor="#DEE1E2" align=center>Shipped Qty</td>
                <td class="NArialL" bgcolor="#DEE1E2" align=center>Unit<br>Price</td>
                <td class="NArialL" bgcolor="#DEE1E2" align=center>Line<br>Total</td>
            </tr>

            <%
                ArrayList lineItemList = ( ArrayList ) request.getAttribute( "lineItems" );

                float totalSalesTaxValue = 0f;
                float salesTaxValue = salesOrder.getSalesTaxValue();

                if( ( lineItemList != null ) && ( lineItemList.size() != 0 ) )
                {
                    int lineItemListSize = lineItemList.size();
                    LineItem lineItem = null;
            %>
                <input type="hidden" name="lineItemListSize" value="<%=lineItemListSize%>"/>
            <%
                    for( int i = 0; i <= ( lineItemListSize-1 ); i++ ) 
                    {
                        lineItem = ( LineItem ) lineItemList.get( i );

                        if(lineItem.getIsTaxable())
						{
                            totalSalesTaxValue += lineItem.getAmount();
                        }
            %>
                    <tr height=30>
                        <td bgcolor='#FFFFEE' class="NArialL" align=center nowrap>&nbsp;<%=(lineItem.getPoLineItemNo() < 1?"":lineItem.getPoLineItemNo()+"") %></td>
                        <% if (ConfigManager.getBooleanProperty(ConfigManager.SHOW_MFG_PARTNO_PACKINGSLIP ) ) { %>
                        <td bgcolor='#FFFFEE' class="NArialL" align=center nowrap><%=lineItem.getManufacturingPartNo()%></td>
                        <% } if (ConfigManager.getBooleanProperty(ConfigManager.SHOW_MRKT_PARTNO_PACKINGSLIP ) ) { %>
                        <td bgcolor='#FFFFEE' class="NArialL" align=center nowrap><%=lineItem.getMarketingPartNo()%></td>
                        <% } %>
                        <td bgcolor='#FFFFEE' class="NArialL" align=center nowrap><%=(lineItem.getCustomerPartNumber() != null) ? lineItem.getCustomerPartNumber() : "&nbsp;" %></td>
                        <td width="240" bgcolor="#FFFFEE" class="NArialL" align=center ><%=( ( lineItem.getDescription() == null ) || ( lineItem.getDescription().trim().length() == 0 ) ) ? "&nbsp;" : lineItem.getDescription()%></td>
						<td bgcolor="#FFFFEE" class="NArialL" align=right nowrap><%=( ( lineItem.getUom() == null ) || ( lineItem.getUom().trim().length() == 0 ) ) ? "&nbsp;" : lineItem.getUom()%></td>
                        <td bgcolor="#FFFFEE" class="NArialL" align=center nowrap>
                            <input type="hidden" name="<%="lineItemId_" + i%>" value="<%=lineItem.getLineItemId()%>"/>
                        <%
                            if("deleteConfirm".equalsIgnoreCase(action)==false)
							{

                        %>
                            <input type='text' name='<%="scheduleNumber_" + i%>' value='<%=lineItem.getScheduleNumber()%>' maxlength='50' class='txfield' disabled='true' />
                            hhhh
                        <%	} 
							else 
							{ 
						%>
                            <%=lineItem.getScheduleNumber()%>
                        <%
                            }
                        %>
                        </td>

                        <td bgcolor="#FFFFEE" class="NArialL" align=center nowrap>
                            <input type="hidden" name="<%="lineItemId_" + i%>" value="<%=lineItem.getLineItemId()%>"/>
                        <%
                            if("deleteConfirm".equalsIgnoreCase(action)==false)
							{
                        %>
                            <input type='text' name='<%="scheduleNumberDescription_" + i%>' value='<%=lineItem.getScheduleDescription()%>' maxlength='50' class='txfield' disabled='true' />

                        <%	}
							else
							{
						%>
                            <%=lineItem.getScheduleDescription()%>
                        <%
                            }
                        %>
                        </td>


                        <td bgcolor="#FFFFEE" class="NArialL" align=center nowrap>
                        <%
                            if("deleteConfirm".equalsIgnoreCase(action)==false)
							{
                        %>
                            <input type='text' name='<%="eccn_" + i%>' value='<%=lineItem.getEccn()%>' maxlength='50' class='txfield' disabled='true' />

                        <%	} 
							else 
							{ 
						%>
                            <%=lineItem.getEccn()%>
                        <%
                            }
                        %>
                        </td>

						<td bgcolor="#FFFFEE" class="NArialL" align=center nowrap>
                        <%
                            if("deleteConfirm".equalsIgnoreCase(action)==false)
							{
                        %>
                            <input type='text' name='<%="licenseException_" + i%>' value='<%=( ( lineItem.getLicenseException() == null ) || ( lineItem.getLicenseException().trim().length() == 0 ) ) ? "" : lineItem.getLicenseException()%>' maxlength='50' class='txfield' disabled='true' />

                        <%	} 
							else 
							{ 
						%>
                            <%=( ( lineItem.getLicenseException() == null ) || ( lineItem.getLicenseException().trim().length() == 0 ) ) ? "&nbsp;" : lineItem.getLicenseException()%>
                        <%
                            }
                        %>
                        </td>

						<td bgcolor="#FFFFEE" class="NArialL" align=right nowrap><%=lineItem.getQtyAsString()%></td>
                        <td bgcolor="#FFFFEE" class="NArialL" align=right nowrap><%=lineItem.getDisplayUnitPrice()%></td>
                        <td bgcolor="#FFFFEE" class="NArialL" align=right nowrap><%=lineItem.getAmountAsString()%></td>
                    </tr>
            <%
                    }       // while (lineItems.hasNext()) ...
                }           // if ((lineItemList != null) ...
            %>

        </table>
       </td></tr>

        <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tR>

        <tr><td colspan=5 bgcolor="#DEE1E2" align="right"><font class="NArialL">
        Grand Total:<%=StringUtils.formatAmountWithNoOfDecimals((salesOrder.getSubTotalAsDouble() ))%>
        </font></td></tR>

        <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=40></td></tR>

        <tr><td colspan=5>
        <table width="100%" border="0">
            <tr>
                <td width="20%" class="NArialL" align="right">TOTAL PKGS:</td>
                <td width="5%"  class="NArialL" align="center"><bean:write name="commercialInvoiceForm" property="totalPackagesStr"/></td>
                <td width="5%" class="NArialL" align="right">&nbsp;</td>
                <td colspan="2" width="65%" class="NArialL" align="right">&nbsp;<!-- < b e a n: m es sa g e  k e y =" label.commercialInvoice.LicenseSymbol" / >: --></td>
                <td width="5%"  class="NArialL" align="left">&nbsp;
                <%
                //if("deleteConfirm".equalsIgnoreCase(action)==false){
                %>
                    <!-- < h tm l : t ex t name="commercialInvoiceForm" maxlength="50" property="licenseSymbol" styleClass="txfield"/ > -->
                <%
                  //  } else {
                %>
                    <!-- < b ea n:  w ri te  name="commercialInvoiceForm" property="licenseSymbol" / > -->
                <% 
				//	}
                %>
                </td>
            </tr>
            <tr>
                <td width="20%" class="NArialL" align="right">
					<% if( ConfigManager.getShowPackageDimensionInPackingSlip() ) { %>
                    NET WEIGHT:
                    <% } else { %>
                    WEIGHT:
                    <% } %>
				</td>
                <td width="5%"  class="NArialL" align="center"><bean:write name="commercialInvoiceForm" property="totalWeight"/></td>
                <td width="5%" class="NArialL" align="left">
                    &nbsp;&nbsp;
                    <logic:notEqual value="" name="commercialInvoiceForm" property="totalWeight">
                    <bean:write name='commercialInvoiceForm' property='weightType'/>
                    </logic:notEqual>
                    &nbsp;
                </td>
                <td colspan="2" width="65%" class="NArialL" align="right">&nbsp;<!-- < b ea n : m es s a ge  key="label.commercialInvoice.ECCN" / >: --></td>
                <td width="5%"  class="NArialL" align="left">&nbsp;
                <%
                //if("deleteConfirm".equalsIgnoreCase(action)==false){
                %>
                    <!-- < h t m l : te x t  name="commercialInvoiceForm" maxlength="50" property="eccn" styleClass="txfield" / > -->
                <%
                  //  } else {
                %>
                    <!-- < b ea n :w ri t e  n am e = "c o mm e r ci a lI n vo i ceF o rm "  p r o pe r ty ="eccn" / >  -->
                <% 
					//}
                %>
                </td>
            </tr>
        </table>
        </td></tr>
        <%
        // Chnaged by hareesh on 28th July 2003
        // -- START --
        if("deleteConfirm".equalsIgnoreCase(action)==false){
        %>
            <tr><td colspan=5 align="center">

            <!- changed by hareesh on 3rd September 2003, Since once Shipped don't allow user to edit commercial Invoice -->
            <% String status = commericalInvoiceForm.getStatus().trim();
                if ( ( Constants.CUSTOMER_SHIPPING_STATUS_CANCELLED != status ) &&
                     (Constants.CUSTOMER_SHIPPING_STATUS_SHIPPED != status ) ) {
            %>

                <chiptrack:restrictedLink functionality='<%=Functionality.COMMERCIAL_INVOICE%>' action="<%=User.USER_ACTION_MODIFY%>" href="javascript:saveInvoice();" onmouseover="window.status='Click to Save this Commercial Invoice';return true" onmouseout="window.status='';return true">
                <img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" title="Click here to Save this Commercial Invoice"></chiptrack:restrictedLink>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <%
                }
            %>

            <a href="javascript:cancelAndGoBack();" onMouseOver="window.status='Click to Cancel and go Back';return true" onMouseOut="window.status='';return true"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" title="Click here to Cancel and go Back "></a>
            </td></tr>
        <% }
        // -- END --
        %>
    </table>
    <%
        }       // if (salesOrder != null)...
    %>
</html:form>
<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->
<%@include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</body>
</html>